package com.dxb.test.spring_async;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * 线程本地数据测试控制器
 *
 * @author DLS
 * @date 2023/02/03
 */
@RestController
public class ThreadLocalDataTestController {
    @Autowired
    private ThreadLocalDataTestService threadLocalDataTestService;

    @GetMapping("go")
    public void go(@RequestParam String v) {
        ThreadLocalDataContext.set(v);
        threadLocalDataTestService.go();
        //ThreadLocalDataContext.remove();
    }

}
